<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>

<jsp:useBean id="nowDate" class="java.util.Date" />
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>编辑窗口</title>
	<!-- import css and js --> 
	<%@ include file="/common/metaInput.jsp" %>  
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${ctx}/js/jsp/yd/logic/ItemStateData.js"></script>
<script type="text/javascript">
var basic_Url="${ctx}/yd/logic/soquote";
var ItemStateList = ItemStateData.Rows;//物料等级

var grid;
/* 自动加载 */
$(function(){
	
	//表格
	var griddata ={};
	grid = $("#table1").ligerGrid({
        columns: [{ display: 'ID', name: 'id', width: 1 , hide:true},
                  { display: '<font color="gray">产品编码</font>', name: 'prodNo',width: 150 },
				  { display: '<font color="gray">产品名称</font>', name: 'prodName', width: 1 , hide:true },
                  { display: '<font color="gray">产品型号</font>', name: 'prodModel', width: 1 , hide:true },
                  { display: '<font color="gray">型号规格</font>', name: 'prodSpecDesc', width: 150},
                  { display: '<font color="gray">基本单位</font>', name: 'prodBUnit', width: 80},
                  { display: '<font color="gray">基本单位数量</font>', name: 'prodBQuantity', width: 100},
                  { display: '<font color="gray">单位换算率</font>', name: 'prodUnitConvert', width: 70},
                  { display: '等级<font color="red">*</font>', name: 'status', width: 60
                	    //<c:choose>
		           	    <c:when test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
                	  ,editor: { type: 'select', data: ItemStateList, valueColumnName: 'ItemStateID', displayColumnName: 'ItemStateName'},
						 render: function (item){
				        for (var i = 0; i < ItemStateList.length; i++){
				        	if (ItemStateList[i]['ItemStateID'] == item.status){
				          	  	return ItemStateList[i]['ItemStateName'];
				            }
				        }
						return item.status;
						}
                	  </c:when>
						<c:otherwise>
						,render: function (item){
							 var state=item.status;
			           		  if(state=="1"){
			           			  return "一等品";
			           		  }
			           		  if(state=="2"){
			           			  return "次品";
			           		  }
			           		  if(state=="3"){
			           			  return "旧件";
			           		  }
							}
						</c:otherwise>
						</c:choose>
					},
                  { display: '单位<font color="red">*</font>', name: 'prodUnit', width: 80
						//<c:if test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
						,editor : {type:'selecturl',dataItem:'dataItem',path:'${ctx}/yd/basic/measurementUnit/unitlist.do',valueColumnName: 'unitname', displayColumnName: 'unitname'}, 
	           	 	   render: function (item){//渲染
	           	 		 	var dataitem = $.parseJSON($("#dataItem").val());
	           	 	   		var tmpProdUnit = item.prodUnit;
	           	 		  	if(undefined != dataitem){
	           	 			 	for (var i = 0; i < dataitem.length; i++){
	                                if (dataitem[i]['unitname'] == item.prodUnit&&dataitem[i]['materialscode']==item.prodNo){
	                                	item.prodUnitConvert = dataitem[i]['unitconvert'];
	                                	tmpProdUnit = dataitem[i]['unitname'];
	                                } 
	                            }
	           	 		  	}
	           	 			dealProductQuantity(item);
	                        return tmpProdUnit;
	                    }
						//</c:if>
				  },
                  { display: '数量<font color="red">*</font>', name: 'prodQuantity', width: 80
						//<c:if test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
						,editor: { type: 'float'},
					  render:function(item){
						  dealProductQuantity(item);
						  return item.prodQuantity;
					  }
						//</c:if>
                  },
                  { display: '人民币单价(基本单位)<font color="red">*</font>', name: 'prodPrice', width: 150
                	  //<c:if test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
                	  ,editor: { type: 'float'},
                	  render:function(item){
						  dealProductPrice(item);
						  return item.prodPrice;
					  }
                	//</c:if>
                  },
//                   { display: '<font color="gray">人民币单价</font>', name: 'prodRmbPrice', width: 80,
//                 	  render:function(item){
//                 		  if(!isNaN(item.prodPrice) ){
//                 			  item.prodRmbPrice=(item.prodPrice*$("#exchangeRate").val()).toFixed(4);
//                 		  }
//                 		  return item.prodRmbPrice;
//                 	  }
//                   },
                  { display: '税率(%)<font color="red">*</font>', name: 'prodTaxRate', width: 80
                	//<c:if test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
                	  ,editor: { type: 'float'},
                	  render:function(item){
						  dealProductPrice(item);
						  var tmpShow = item.prodTaxRate;
						  if(undefined != item.prodTaxRate && null != item.prodTaxRate){
							  tmpShow +="";
						  }
						  return tmpShow;
					  }
                	//</c:if>
                  },
                  { display: '<font color="gray">含税人民币单价</font>', name: 'prodPriceWithTax', width: 100},
//                   { display: '折扣率(%)', name: 'prodDiscountRate', width: 80,editor: { type: 'float'}},
//                   { display: '实际含税单价', name: 'prodActPriceWithTax', width: 100},
                  { display: '备注', name: 'remark', width: 150
                	//<c:if test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
						,editor: { type: 'text'}
					//</c:if>
                  }
                  ],
                  enabledEdit: true,
                  usePager: true,pageSize:1000,pageSizeOptions:[1000],
                  //data : griddata,
                  parms:[{ name : 'id' , value : '${so.id}'}],
                  url : basic_Url+"/griditems.do",
                  width: "100%", height:'90%', checkbox: true
                //<c:if test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
                  ,toolbar: { items: [
                                     { text: '添加', click: ItemWindow, icon: 'add' },
                                     { line: true },
                                     { text: '删除', click: deleteRow, img: '${ctx}/js/ligerUI/skins/icons/delete.gif' }
                                     ]
                  }
                //</c:if>
    });
	
	//表格数据加载
	/* var manager = $("#table1").ligerGetGridManager();
	//<c:forEach items='${soitem}' var='item'>
	manager.addRow2({
		id : "${item.id}" ,
		materialsid:"${item.materialsid}",
		prodNo :"${item.prodNo}",
		prodName: "${item.prodName}",
		prodModel: "${item.prodModel}",
		prodBUnit:"${item.prodBUnit}",
		prodBQuantity:"${item.prodBQuantity}",
		prodUnit:"${item.prodUnit}",
		prodUnitConvert:"${item.prodUnitConvert}",
		prodQuantity:"${item.prodQuantity}",
		prodSpecDesc: "${item.prodSpecDesc}",
		prodPrice : "${item.prodPrice}",
		prodPriceWithTax : "${item.prodPriceWithTax}",
		prodTaxRate : "${item.prodTaxRate}",
		status: "${item.status}",
		
		//prodRmbPrice:("${item.prodPrice}"*$("#exchangeRate").val()).toFixed(4),
// 		prodDiscountRate : "${item.prodDiscountRate}",
// 		prodActPriceWithTax : "${item.prodActPriceWithTax}",
		remark : "${item.remark}"
    });
	//</c:forEach> */

	//表单提交验证
	$("#inputForm").validate({			   
	onsubmit: true,
	 /*执行ajaxsubmit  */ 
    submitHandler: function(editform) {
        try{			    		
            url =  basic_Url+"/save.do";
            var api = frameElement.api;
        	var W = api.opener;
            getReturnMessage(url,"inputForm",W.searchAP);
        }catch(e){alert(e);}
    }
	});

	
	//添加模式隐藏DIV
	if("${flag}" =="ADD"){
		$("#tr1").hide();
		$("#tr2").hide();
	}
	$("#tr2").hide();
	
	//按钮处理
	/* btn status -- huang.xuming[2013-07-15]*/
	$("[id^='btn_fb_']").hide();
	var curStatus = "${so.billstatus}";//当前所在环节、状态
	if(curStatus == ''){//建单
		$("#btn_fb_save").show();
	}else {
		//$("#btn_fb_exportExcel").show();
		formComponentDisabled(true);//禁用控件
		if (curStatus == '0'||curStatus == '6' ||curStatus == '7'){//草稿状态-提交二级
			if("${user.name}"=="${so.dcruser}"){
				$("#btn_fb_approve_2").show();
			}
			
			formComponentDisabled(false);//启用控件
		}else if (curStatus == '2'){//二级审批中状态
			$("#btn_fb_approve_3").show();
			$("#btn_fb_rebut_2").show();
			$("#btn_fb_end_2").show();
		}else if (curStatus == '3'){//三级审批中状态
			$("#btn_fb_rebut_3").show();
			$("#btn_fb_end_3").show();
		}else if (curStatus == '4'){//二级结案状态
			$("#btn_fb_rebut_3").show();// 被操作后不可驳回?
		}else if (curStatus == '5'){//三级结案状态
			
		}else{
			
		}
	}
	
	
	//页面加载标识隐藏
	$("#pageloading").hide();
	
	//=============================
	
	//币种改变触发 //XXX 完善优化
// 	$("#currency").change(function() {
// 		if(''== $("#currency").val()){
// 			$("#exchangeRate").val('');
// 		}
// 		//<c:forEach items='${currency}' var='item'>
// 		else if ('${item.currencyname}' == $("#currency").val()) {
// 			$("#exchangeRate").val('${item.exchangeRate}');
// 		}
// 		//</c:forEach>
		
// 		// -add 20130925 
// 		var data = grid.getData();
// 		if(null != data && data.length > 0){
// 			$(data).each(function (){
// 				if(!isNaN(this.prodPrice) ){
//        			  this.prodRmbPrice=(this.prodPrice*$("#exchangeRate").val()).toFixed(4);
//        		  	}
// 			});
// 			grid.reRender();
// 		}
// 	});
	
});

//物料选择弹窗
function ItemWindow(){
// 	var exchangeRate = $("#exchangeRate").val();
// 	if(""==exchangeRate ||isNaN(exchangeRate)){
// 		$.dialog.alert("请先选择币别");
// 		return ;
// 	}
	
	getDG().dialog({
		title:'选择产品',
		width : 650,
		height : 350,
		content: 'url:' + sys_context+'/public/windowalert/itemmanager.do?typeName='+encodeURIComponent("成品物料"),
		lock : true,
		max : true,
		min : true,
		ok: function(){
			var getSelectedHub=this.content.getSelected();
			var manager = $("#table1").ligerGetGridManager();
			if (getSelectedHub != null) {
				 $(getSelectedHub).each(function (){
					                manager.addRow2({
					                	prodName: this.name,
 					                	//prodModel: this.brand,
				                		prodPrice : this.price,
				                		prodSpecDesc : this.spec,
				                		prodBUnit : this.unit,
				                		materialsid: this.id,//物料ID
				                		prodNo : this.code
				                	});
				 });	
			}
			this.content.Close();
    		return false;
	    },
	    cancelVal: '关闭',
	    cancel: true 
	}).zindex();
}
	
//提交表单触发
function submitForm(param){
    //设置ajax全局同步
    $("#paramflag").val(param);
	
	var data = grid.getData();
	//var tbColumns =grid.columns; 
	var dl=grid.getDeleted();
	if(data.length==0){
		$.dialog.alert("请选择产品");
   	 	return false;
	}
	var ba=true;
	if(data !=null){
		if (param == 0 || param == 1){
			var j=0;
			$(data).each(function (){
				j++;
				
				if (undefined == this.status
						|| null == this.status) {
					$.dialog.alert("第" + j + "行的“等级”数据不合法");
					ba = false;
					return false;
				}
				
		        if( undefined==this.prodPrice ||isNaN(this.prodPrice) ||this.prodPrice<=0){
		            $.dialog.alert("第"+j+"行的“单价”数据不合法");
		            ba=false;
		            return false;
		        }
		        if( undefined==this.prodPriceWithTax ||isNaN(this.prodPriceWithTax) ||this.prodPriceWithTax<=0){
		            $.dialog.alert("第"+j+"行的“含税单价”数据不合法");
		            ba=false;
		            return false;
		        }
		        if( undefined==this.prodTaxRate ||isNaN(this.prodTaxRate) ){
		            $.dialog.alert("第"+j+"行的“税率”数据不合法");
		            ba=false;
		            return false;
		        }
		        
		        if( undefined==this.prodQuantity ||isNaN(this.prodQuantity) ||this.prodQuantity<=0){
		            $.dialog.alert("第"+j+"行的“数量”数据不合法");
		            ba=false;
		            return false;
		        }
		        
		        if (undefined == this.prodUnit
						|| ""==this.prodUnit) {
					$.dialog.alert("第" + j + "行的“单位”数据不合法");
					ba = false;
					return false;
				}
		 	});	
		}
	}
	jQuery.ajaxSettings.async = false;

	if(ba){
		$("#itemdata").val(JSON.stringify(data));
		$("#itemdelete").val(JSON.stringify(dl));
	  	$("#submitFlag").val(param);
	    //提交前启用控件
	  	formComponentDisabled(false);
	    $("#inputForm").submit();
	}
 }	

function tableSubmit(msg,param){
	$.ligerDialog.confirm(msg, 
			function (flag) { 
			if(flag){
				submitForm(param);
				}
		}); 
}

function submitFormClose(param){
	tableSubmit('是否确认关闭单据操作？',param);
}

function submitFormEnd(param){
	tableSubmit('是否确认审批完结操作？',param);
}

function submitFormRebut(param){
	tableSubmit('是否确认驳回操作？',param);
}

function deleteRow()
{ 
	grid.deleteSelectedRow();
}

function exportExcel(){
	var path = basic_Url+"/exportExcel.do?id=${so.id}";
   	window.open(path,"_blank");
}

/**
 * 产品的数量计算
 * @param item
 */
function dealProductQuantity(item){
	if(undefined == item){
		return;
	}
	
	//计算
	//计算基本单位数量 parseFloat()
	if(!isNaN(item.prodQuantity) && !isNaN(item.prodQuantity)){
		item.prodBQuantity = item.prodQuantity*item.prodUnitConvert ;
	}else{
		item.prodBQuantity=null;//清除值
	}
	
}

/**
 * 产品的价格计算
 * @param item
 */
function dealProductPrice(item){
	if(undefined == item){
		return;
	}
	
	//清空数据
	item.prodPriceWithTax=null;
	
	//价格计算
	if(!isNaN(item.prodPrice) && !isNaN(item.prodTaxRate)){
		//RMB单价 - add 20130905
// 		if(!isNaN($("#exchangeRate").val())){
// 			item.prodRmbPrice=(item.prodPrice*$("#exchangeRate").val()).toFixed(4);
// 		}
		
		//含税单价
		item.prodPriceWithTax = item.prodPrice * (1 + item.prodTaxRate*0.01);
		item.prodPriceWithTax = item.prodPriceWithTax.toFixed(4);//解决浮点数精度问题
	}
}
</script>

</head>

<body>

<form id="inputForm" action="" method="post">
<input type="hidden" id="id" name="id" value="${so.id}"/>
<input type="hidden" id="version" name="version" value="${so.version}"/>
<input type="hidden" id="itemdata" name="itemdata" value=""/>
<input type="hidden" id="itemdelete" name="itemdelete" value=""/>
<input type="hidden" id="paramflag" name="paramflag" value=""/>
<input type="hidden" id="dataItem" name="dataItem"/><!-- 单位获取辅助 -->
<!-- 用于标识提交按钮 -->
<input type="hidden" id="submitFlag" value="" />
 <div class="pageContent" >
    <div class="panel">
         <table class="TableBlock" align="center">
					<tr id="tr1">
						<td nowrap="nowrap" width="20%">报价单编号:</td>
						<td width="30%"><input type="text" id="no" name="no"
							value="${so.no}" class="inp_width_98p" readonly="readonly"/></td>
						<td nowrap="nowrap" width="20%">建单时间:</td>
						<td width="30%"><input type="text" id="dctime" name="dctime" class="inp_width_98p"
							value="<fmt:formatDate value="${empty so.dctime?nowDate:so.dctime}" type="both" dateStyle="long" pattern="yyyy-MM-dd" />" readonly="readonly"/></td>
					</tr>
   		           <tr>
   		           		<td nowrap="nowrap">客户编号:</td>
   		           		<td><input type="text" id="cliNo" name="cliNo" value="${so.cliNo}" class="inp_width_98p required" readonly="readonly"></input></td>
   		           		<td nowrap="nowrap">报价有效期:</td>
   		           		<td><input type="text" id="quoteExp" name="quoteExp" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="inp_width_98p Wdate" value="<fmt:formatDate value="${so.quoteExp}" pattern="yyyy-MM-dd" type="both" />"  readonly="readonly"/>
   		           		</td>
   		           </tr>
   		           <tr>
   		           		<td nowrap="nowrap">客户单位名称:</td>
   		           		<td><input type="text" id="cliName" name="cliName" value="${so.cliName}" class="inp_width_98p required" readonly="readonly"></input></td>
   		           		<td nowrap="nowrap">客户联系人:</td>
   		           		<td><input type="text" id="cliPeo" name="cliPeo" value="${so.cliPeo}" class="inp_width_98p required"></input></td>
   		           </tr>
   		           <tr>
   		           		<td nowrap="nowrap">客户联系电话:</td>
   		           		<td><input type="text" id="cliTel" name="cliTel" value="${so.cliTel}" class="inp_width_98p required"></input></td>
   		           		<td nowrap="nowrap">传真:</td>
   		           		<td><input type="text" id="cliFax" name="cliFax" value="${so.cliFax}" class="inp_width_98p"></input></td>
   		           </tr>
   		           <tr>
   		           		<td nowrap="nowrap">客户地址:</td>
   		           		<td colspan="3"><input  type="text" id="cliAddr" name="cliAddr" value="${so.cliAddr}" class="inp_width_98p required"></input></td>
   		           </tr>
   		           <tr>
   		           		<td nowrap="nowrap">付款方式:</td>
   		           		<td>
   		           		<c:choose>
   		           		<c:when test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
   		           		<select id="payMode" name="payMode" class="inp_width_98p required" >
   		                 	<option></option>
   		                 	<c:forEach items="${payments }" var="item">
   		                 		<option value="${item.name }">${item.name }</option>
   		                 	</c:forEach>
   		                 </select>
   		                 	<script type="text/javascript">
   		           				$("#payMode").val("${so.payMode}");
   		           			</script>
   		           		</c:when>
						<c:otherwise>
						<input type="text" value="${so.payMode}" id="payMode" name="payMode" class="inp_width_98p required" readonly="readonly"></input>
						</c:otherwise>
						</c:choose>
   		           		</td>
   		           		<td nowrap="nowrap">交货方式:</td>
   		           		<td>
   		           		<c:choose>
   		           		<c:when test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
   		           		<select id="deliveryMode" name="deliveryMode" class="inp_width_98p required" >
   		                 	<option></option>
   		                 	<c:forEach items="${deliveries }" var="item">
   		                 		<option value="${item.name }">${item.name }</option>
   		                 	</c:forEach>
   		                 </select>
   		                 	<script type="text/javascript">
   		           				$("#deliveryMode").val("${so.deliveryMode}");
   		           			</script>
   		           		</c:when>
						<c:otherwise>
						<input type="text" value="${so.deliveryMode}" id="deliveryMode" name="deliveryMode" class="inp_width_98p required" readonly="readonly"></input>
						</c:otherwise>
						</c:choose>
   		           		</td>
   		           </tr>
   		            <%-- <tr>
   		           		<td nowrap="nowrap">币别:</td>
   		           		<td>
   		           		<c:choose>
   		           		<c:when test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
   		           		<select id="currency" name="currency" class="inp_width_98p required">
								<option></option>
								<c:forEach items="${currency }" var="item">
									<option value="${item.currencyname }">${item.currencyname}</option>
								</c:forEach>
						</select> 
						<script type="text/javascript">
							$("#currency").val('${so.currency}');
						</script>
						</c:when>
						<c:otherwise>
						<input type="text" value="${so.currency}" id="currency" name="currency" class="inp_width_98p required" readonly="readonly"></input>
						</c:otherwise>
						</c:choose>
   		           		</td>
   		           		<td nowrap="nowrap">汇率:</td>
   		           		<td><input type="text" id="exchangeRate" name="exchangeRate" value="${so.exchangeRate}" class="inp_width_98p required" readonly="readonly"></input></td>
   		           </tr> --%>
   		           <tr>
   		           		<td nowrap="nowrap">发票类型:</td>
   		           		<td><input type="text" id="invoiceType" name="invoiceType" value="${so.invoiceType}" class="inp_width_98p"></input></td>
   		           		<td nowrap="nowrap">交期:</td>
   		           		<td>
   		           			<input type="text" id="deliveryPeriod" name="deliveryPeriod" value="${so.deliveryPeriod}" class="required"></input>
   		           			<select id="deliveryPeriodReducedUnit" name="deliveryPeriodReducedUnit">
   		           				<option value="天">天</option>
   		           				<option value="周">周</option>
   		           				<option value="月">月</option>
   		           			</select>
   		           			<script type="text/javascript">
   		           				$("#deliveryPeriodReducedUnit").val("${so.deliveryPeriodReducedUnit}");
   		           			</script>
   		           		</td>
   		           		
   		           </tr>
   		           <tr>
   		           		<td nowrap="nowrap">制单人:</td>
   		           		<td><input type="text" id="listerName" name="listerName" class="inp_width_98p" value="${empty so.listerName?user.realName:so.listerName}" readonly="readonly"></input></td>
   		           		<td nowrap="nowrap">制单人部门:</td>
   		           		<td>
   		           		<c:choose>
   		           		<c:when test="${'ADD' eq flag or '0'eq so.billstatus or '6'eq so.billstatus or '7'eq so.billstatus}">
   		           		<select id="listerDeptName" name="listerDeptName" class="inp_width_98p">
								<option></option>
								<c:forEach items="${depts }" var="item">
									<option value="${item.depname }">${item.depname}</option>
								</c:forEach>
						</select> 
   		           			<script type="text/javascript">
   		           				$("#listerDeptName").val("${so.listerDeptName}");
   		           		</script>
   		           		</c:when>
						<c:otherwise>
						<input type="text" value="${so.listerDeptName}" id="listerDeptName" name="listerDeptName" class="inp_width_98p" readonly="readonly"></input>
						</c:otherwise>
						</c:choose>
   		           		</td>
   		           </tr>
   		           <tr id="tr2">
   		           		<td nowrap="nowrap">审核人:</td>
   		           		<td><input type="text" id="auditorName" name="auditorName" value="${so.auditorName}" class="inp_width_98p" readonly="readonly"></input></td>
   		           		<td nowrap="nowrap">批准人:</td>
   		           		<td><input type="text" id="approverName" name="approverName" value="${so.approverName}" class="inp_width_98p" readonly="readonly"></input></td>
   		           </tr>
   		           <tr>
                    <td nowrap="nowrap">备注:</td>
   		                 <td colspan="3">
   		                <input  type="text" id="remark" name="remark" value="${so.remark}" class="inp_width_98p"/>
   		                 </td>
   		           </tr>
                </table>
                <div id="table1"> </div>    
         </div>
         <div class="formBar">
	        <ul>
	        	<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="btn_fb_save" onclick="submitForm(0)">保存</button></div></div></li>
		      	<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="btn_fb_approve_2" onclick="submitForm(2)" title="提交二级审核">提交</button></div></div></li>
		      	<webres:displaycontroller elementId="LOGIC_SOQUOTE_2SEHNHE" description="销售报价二级审核">
		      	<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="btn_fb_approve_3" onclick="submitForm(3)" title="提交三级审核">二级审核</button></div></div></li>
		      	</webres:displaycontroller>
		      	<webres:displaycontroller elementId="LOGIC_SOQUOTE_2WANJIE" description="销售报价二级完结">
		      	<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="btn_fb_end_2" onclick="submitFormEnd(4)" title="二级结案">二审完结</button></div></div></li>
		      	</webres:displaycontroller>
		      	<webres:displaycontroller elementId="LOGIC_SOQUOTE_3WANJIE" description="销售报价三级完结">
		      	<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="btn_fb_end_3" onclick="submitFormEnd(5)" title="三级结案">三审完结</button></div></div></li>
		      	</webres:displaycontroller>
		      	<webres:displaycontroller elementId="LOGIC_SOQUOTE_2BOHUI" description="销售报价二级驳回">
		      	<li><div class="button"><div class="buttonContent"><button type="button" id="btn_fb_rebut_2" onclick="submitFormRebut(6)" title="二级驳回到草稿">驳回</button></div></div></li>
		      	</webres:displaycontroller>
		      	<webres:displaycontroller elementId="LOGIC_SOQUOTE_3BOHUI" description="销售报价三级驳回">
		      	<li><div class="button"><div class="buttonContent"><button type="button" id="btn_fb_rebut_3" onclick="submitFormRebut(7)" title="三级驳回到草稿">驳回</button></div></div></li>
		      	</webres:displaycontroller>
		      	<li><div class="button"><div class="buttonContent"><button type="button" id="btn_fb_exportExcel" class="export" onclick="exportExcel()">导出</button></div></div> </li>
		      	<li><div class="button"><div class="buttonContent"><button type="button" onclick="CloseDialog()">关闭</button></div></div></li>
	        </ul>
        </div>    
    </div>
</form>
</body>
</html>
